package com.clinic.entity.gui;

import org.apache.commons.lang.StringUtils;

import com.clinic.entity.type.AppointmentStatus;

public class GuiAppointment {
	
	private long appointmentId;
	private GuiPatient patient;
	private String patientStatus;
	private String codeOrName;
	private String date;
	private String time;
	
	public boolean isAvailable() {
		return appointmentId > 0 && StringUtils.isNotBlank(date) && StringUtils.isNotBlank(time);
	}
	
	public boolean isNotAvailable() {
		return ! isAvailable();
	}

	public long getAppointmentId() {
		return appointmentId;
	}
	
	public void setAppointmentId(long appointmentId) {
		this.appointmentId = appointmentId;
	}
	
	public GuiPatient getPatient() {
		return patient;
	}

	public void setPatient(GuiPatient patient) {
		this.patient = patient;
	}
	
	public String getPatientStatus() {
		return patientStatus;
	}

	public void setPatientStatus(String patientStatus) {
		this.patientStatus = patientStatus;
	}

	public String getCodeOrName() {
		return codeOrName;
	}

	public void setCodeOrName(String codeOrName) {
		this.codeOrName = codeOrName;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}
	
	public AppointmentStatus getAppointmentStatus() {
		return AppointmentStatus.getValue(getPatientStatus());
	}
	
	public boolean isRegistered() {
		return AppointmentStatus.REGISTERED == getAppointmentStatus();
	}
	
	public boolean isUnregistered() {
		return AppointmentStatus.UNREGISTERED == getAppointmentStatus();
	}

}
